<!DOCTYPE html>
<html lang="en">
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
		<meta content="maximum-scale=1" name="viewport">
		<meta name="robots" content="index,follow">
			<title>Commerce</title>
		<meta name="description" content="">
		<meta name="author" content="">
		<link rel="shortcut icon" href="<?php echo base_url();?>assets/img/logo2.png">
		
        <link rel="stylesheet" type="text/css" href="<?php echo base_url();?>assets/css/style.css">
        <link rel="stylesheet" href="<?php echo base_url();?>assets/css/default.css" type="text/css" media="screen" />
        <link rel="stylesheet" href="<?php echo base_url();?>assets/css/nivo-slider.css" type="text/css" media="screen" />
        <link rel="stylesheet" href="<?php echo base_url();?>assets/css/jPages.css" type="text/css" media="screen" />
		
		<script type="text/javascript" src="<?php echo base_url();?>assets/js/jquery-1.9.0.min.js"></script>
        <!--<script type="text/javascript" src="<?php echo base_url();?>assets/js/cf1c345.js"></script>-->
        <!--<script type="text/javascript" src="<?php echo base_url();?>assets/js/cloud-zoom.js"></script>-->
        <script type="text/javascript" src="<?php echo base_url();?>assets/js/jquery.nivo.slider.js"></script>
        <script type="text/javascript" src="<?php echo base_url();?>assets/js/jquery.nivo.slider.pack.js"></script> 
        <script type="text/javascript" src="<?php echo base_url();?>assets/js/jPages.js"></script>
        <script type="text/javascript" src="<?php echo base_url();?>assets/js/jquery.elevateZoom-2.5.5.min.js"></script>
        <script type="text/javascript">
        var site_url = '<?php echo site_url(); ?>';
        </script>
        
	</head>
	<body>
		<div id="psHeader" class="navbar">			 
		
			<div class="navbar-inner">
				<div class="container">
					<a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
						<span class="icon-bar"></span>
						<span class="icon-bar"></span>
						<span class="icon-bar"></span>
					</a>                        
					<div class="pull-left">
                        <a class="brand" href="<?php echo base_url();?>"><img src="<?php echo base_url() ?>assets/img/logo2.png" width="50" height="48"> Store</a>
					</div>              
					<div class="nav-collapse nav-col-cat">
					</div>        
					
                    <?php echo form_open('search/lists','class ="navbar-search pull-left" '); ?>
                    	<input type="text" onblur="if(this.value=='') this.value='Search Product...';" onfocus="if(this.value=='Search Product...') this.value='';" name="search" id="search" value="Search Product...">
                        <!--<input type="submit" name="submit" id="submit" value="Search" class="btn">-->
                        <button type="submit" class="btn">Search</button>
                    <?php echo form_close(); ?>		
					<!--<form class="navbar-search pull-left" action="" method="get">
						<input type="text" placeholder="Sepatu, Gadget..." name="search" id="search" value="">
						<button type="submit" class="btn">Cari</button>
					</form>-->
                    
                   
                   <div id="currency" class="currency">
                            <h5>Currency</h5>
                            <?php foreach($currency as $valc){ ?>
                                <?php if($valc->status == 1) {?>  
                                    <?php if($valc->symbol_left == NULL){ ?>
                                    <a href="<?php echo site_url('content/set_currency/'.$valc->currency_id) ?>" name="<?php echo $valc->code; ?>" title="<?php echo $valc->title;?>" ><?php echo $valc->symbol_right; ?></a>													
                                    <?php }else if($valc->symbol_right == NULL){ ?>
                                    <a href="<?php echo site_url('content/set_currency/'.$valc->currency_id) ?>" name="<?php echo $valc->code; ?>" title="<?php echo $valc->title;?>" ><?php echo $valc->symbol_left; ?></a>	
                                    <?php } ?>  
                                <?php } ?>
                                		 
                            <?php } ?>
                            
                    </div>
                    
					<div class="nav-collapse pull-right">
						<ul class="nav">
							<?php $user_id = Modules::run('auth/get_user_id'); ?>
                            <?php $stores = $this->content_model->get_store($user_id) ?>
                        	<?php if(Modules::run('auth/is_login')) {?>
                            	<?php if($stores == NULL){ ?>
                            		<li class="nav-high"><a href="<?php echo site_url('store/create') ?>" title="Open Store">Open Store</a></li>
                                <?php }else{ ?>
                                	<li class="nav-high"><a href="<?php echo site_url('store/lists/'.$stores->toko_id) ?>" title="My Store">My Store</a></li>
                                <?php } ?>
                            <?php }else{ ?>
								<li class="nav-high"><a href="<?php echo site_url('auth/register'); ?>" title="Open Store">Open Store</a></li>
                            <?php } ?>
                            <?php if(Modules::run('auth/is_login')) :?>
							<li class="dropdown pull-right">
								<a href="<?php echo site_url('auth/logout2'); ?>"	class="dropdown-toggle dropdown-hover" title="Logout">Logout </b></a>
							</li>
							<?php else :?>
							<li class="dropdown pull-right">
								<a href=""	class="dropdown-login dropdown-hover" id="login" data-toggle="dropdown" title="Login">Login </b></a>
                                <div id="arrow"></div>
                                <div class="dropdown-menu" style="padding: 15px; padding-bottom: 0px;">
                                	<?php
									$login = array(
										'name'	=> 'login',
										'id'	=> 'login',
										'value' => set_value('login'),
										'maxlength'	=> 80,
										'size'	=> 30,
										'class' => 'input-block-level',
										'placeholder' => 'Username or Email address'
									);
									/*if ($login_by_username AND $login_by_email) {
										$login_label = 'Email or login';
									} else if ($login_by_username) {
										$login_label = 'Login';
									} else {
										$login_label = 'Email';
									}*/
									$password = array(
										'name'	=> 'password',
										'id'	=> 'password',
										'size'	=> 30,
										'class' => 'input-block-level',
										'placeholder' => 'Password',
									);
									$remember = array(
										'name'	=> 'remember',
										'id'	=> 'remember',
										'value'	=> 1,
										'checked'	=> set_value('remember'),
										'style' => 'margin:0;padding:0',
									);
									$captcha = array(
										'name'	=> 'captcha',
										'id'	=> 'captcha',
										'maxlength'	=> 8,
									);
									?>
									
								<?php //echo validation_errors(); ?>
									
									<?php echo form_open('auth/login2', 'name="form" id="login-form2"'); ?>
									
										<h2 class="form-signin-heading">Please sign in</h2>
										<?php echo form_input($login); ?>
										<span style="color:#E91510"><?php echo form_error($login['name']); ?><?php echo isset($errors[$login['name']])?$errors[$login['name']]:''; ?></span>
										
										
										<?php echo form_password($password); ?>
										<span style="color:#E91510"><?php echo form_error($password['name']); ?><?php echo isset($errors[$password['name']])?$errors[$password['name']]:''; ?></span>
										
										
										<p>
										<label for="remember"><?php echo form_checkbox($remember); ?> Remember me</label>
										</p>
										
										<?php echo form_submit('submit', 'Sign in','class="btn btn-primary" type="submit" id="btn-login"'); ?>
										
										<span style="float:right"> 
									<a href="<?php echo base_url('auth/forgot_password'); ?>"> Forgot password ? </a>
										</span>
										
									<?php echo form_close(); ?>
                                </div>
							</li>
							<?php endif; ?>
							<li class="dropdown pull-right">
								<a href="<?php echo site_url('checkout/cart/'); ?>" class="dropdown-toggle dropdown-hover" title="Keranjang">
									<span id="cart-item"></span>Shopping Cart <b class="caret"></b>
								</a>								
							</li>
						</ul>
					</div> 
                    
                        
				</div>
			</div>
		</div>
<script>
	$(function() {
	  // Setup drop down menu
	  $('.dropdown-login').dropdown();
	 
	  // Fix input element click problem
	  $('.dropdown input, .dropdown label').click(function(e) {
		e.stopPropagation();
	  });
	});
</script>

<script src="<?php echo base_url();?>assets/js/jquery.validate.js"></script>
    
<script type="text/javascript">
	$("#login-form").validate({
			rules: {
				login: "required",                    
				password: "required",  
			},
			messages: {
				name: "Username or Email is required!",
				password: "Password is required",
			},
			submitHandler: function(form) {					
				form.submit();
				//alert('ok');
			}
		});
</script>